<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/axios.min.js"></script>

    <script type="text/javascript">
        function addUser() {
            axios.post('/v1/user', {
                name: 'Fred',
                password: '123456'
            }).then(function (response) {
                console.log(response);
            }).catch(function (error) {
                console.log(error);
            });
        }

        function getUser() {
            axios.get('/v1/user/1').then(function (response) {
                console.log(response);
            }).catch(function (error) {
                console.log(error);
            });
        }
    </script>
</head>
<body>
<button onclick="addUser()">添加用户</button>
<button onclick="getUser()">查询用户</button>
</body>
</html>